package com.scs.application.modules.base.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.scs.application.core.mapper.IBaseMapper;
import com.scs.application.modules.base.dto.WarehouseSelectDto;
import com.scs.application.modules.base.entity.Matr;
import com.scs.application.modules.base.entity.Warehouse;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 */
public interface WarehouseMapper extends IBaseMapper<Warehouse> {
    /**
    * @Description：设置科室或者用户仓库权限的数据源
    */
     List<Warehouse> getListForSetWarehouse(@Param("setTypeField") String setTypeField,@Param("id") String id);

    /**
     * 选择时 分页查询
     * @param page
     * @param wrapper
     * @param params 真实参数
     * @return
     */
    Page<WarehouseSelectDto> pageForSelect(
            IPage page,
            @Param(Constants.WRAPPER) QueryWrapper<Matr> wrapper,
            @Param("params") Map<String,Object> params,
            @Param("userParam") Map<String,Object> userParam
    );
    /**
     * 选择时 列表查询
     * @param wrapper
     * @param params 真实参数
     * @return
     */
    List<WarehouseSelectDto> listForSelect(
            @Param(Constants.WRAPPER) QueryWrapper<Matr> wrapper,
            @Param("params") Map<String,Object> params,
            @Param("userParam") Map<String,Object> userParam
    );

    List<Warehouse> getCenterWarehouse();
}
